import { http } from '../../request/index'
import {Login} from '../../utilds/asyncWx'
Page({

  data: {

  },
  async handleGetUserInfo(e) {
    try {
      const {encryptedData, rawData, iv, signature} = e.detail;
      const {code} = await Login()
      let loginParams = {
        encryptedData, rawData, iv, signature, code
      }
      // const {token} = await http({url:'/users/wxlogin',methods:'post',data:loginParams});
      // wx.setStorageSync('token', token);
      wx.setStorageSync('token', 'wohuoqubudaotoken,wojiushi');
      wx.navigateBack({
        delta: 1
      })
    } catch (error) {
      console.log(error)
    }
  }
  
})